package org.zkoss.zktc.unittest;

import org.junit.Test;
import org.zkoss.zktc.core.groovy.Engine;
import org.zkoss.zktc.core.groovy.ExecutionException;
import org.zkoss.zktc.core.groovy.SnippetRunner;

public class ButtonGroovyTestCase extends GroovyTestCaseBase {

	// @BeforeClass
	// static public void beforeClass(){
	// TestCaseBase.beforeClass();
	//		
	// }
	protected String getTestCaseUrl() {
		return getTestCaseUrl("/unit/button.zul");
	}

	@Test
	public void testGroovy() throws ExecutionException{
		Engine engine = new Engine(binding);
		engine.execute(getGroovy());
		engine.execute("println '>>>last widget:'+widget;");
	}
	
	@Test
	public void testSnippet() throws ExecutionException{
		SnippetRunner runner = new SnippetRunner(getSnippets(), binding);
		while (runner.hasNextStep()) {
			runner.stepOver();
		}
		runner.getEngine().execute("println '>>>last widget:'");
	}
}
